<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo lang('system_author');?></title>
<link rel="stylesheet" type="text/css" href="<?php echo brd_url('css/style.css')?>" />
<script src="<?php echo brd_url('js/jquery-1.4.4.min.js')?>"></script>
<script>
	$(document).ready(function(){
	var _select=$('.select');
		_select.click(function(){
			$(this).find('ul').show();
		})

		$('.select li').click(function(){
			var eid=$(this).attr('eid');
			var eid_input='<input type="hidden" value="'+eid+'" name="eid" id="eid" \/>';
			var _eidhtml=$(this).html();
			$('.eid_value').html(_eidhtml);
			if($('#eid').attr('value')){
				$('#eid').attr('value',eid);	
			}
		})
		$('.select ul').hover(function(){
			
		},function(){
			$(this).hide();
		})
	 	$("#yzm").focus(function()
		{
		    this._cache=this.value;
			$("#yzm").val('');	
		}).blur(function(){
			  if(this.value=='')
			  this.value=this._cache;
			})
	})

</script>
<script type="text/javascript">
var login_index = "<?php echo site_aurl('main/login_index')?>";
	function login()
	{
      $("#no_user").hide();
      $("#no_pwd").hide();
      $("#no_code").hide();
      $("#code_error").hide();
      $("#user_or_pwd_error").hide();
	  var name = $("#user").val();
          var pwd = $("#password").val();
          var yzm = $("#yzm").val();
	  if(name=='') { $("#no_user").show(); $("#user").focus(); return false;}
	  if(pwd=='') { $("#no_pwd").show();  $("#password").focus(); return false;}
	  if(yzm =='' || yzm == "<?=lang('yzm')?>") 
	  { $("#no_code").show(); $("#yzm").focus(); return false; }
	  $.ajax({
                data:"opt=ajax&name="+name+"&pwd="+pwd+"&yzm="+yzm,
                url:"<?php echo site_aurl('main/login')?>",
                type: "POST",
                success:function(msg)
                {
                   if(msg==1)
                   {
                   $("#code_error").show();
                   $("#yzm").val('');
                   $("#yzm_code").attr('src','<?php echo site_aurl('login/code_img');?>'+ '?' + Math.random());
                   $("#yzm").focus();  
                   }else if(msg==2)
                   {
                   $("#user_or_pwd_error").show();
                   $("#password").val('');
                   $("#password").focus();  
                   }else
                   {
                     window.location.href=login_index;
                   }   
            }  
	  })
	}
</script>
</head>
<body>
	<div class="login">
		<div class="login_form">
			<div class="login_info">
				<div class="login_info_title">选择登录版本：</div>
				<div class="select">
					<p class="eid_value">中文版</p>
					<ul>
						<li eid="english">English</li>
						<li eid="chinese">中文版</li>
					</ul>
					<input type="hidden" value="chinese" name="eid" id="eid" />
				</div>
			</div>
			<div class="form_info">
			    <div class="login_error" id="no_user">
					<label><?php echo lang('enter_user');?></label>
				</div>
				 <div class="login_error" id="no_pwd">
					<label><?php echo lang('enter_pwd');?></label>
				</div>
                 <div class="login_error" id="no_code">
					<label><?php echo lang('enter_code');?></label>
				</div>
				 <div class="login_error" id="code_error">
					<label><?php echo lang('yzm_error');?></label>
				</div>
				 <div class="login_error" id="user_or_pwd_error">
					<label><?php echo lang('name_or_pass_error');?></label>
				</div>
				<div class="field">
					<label><?php echo lang('user_name');?>：</label>
					<input type="text" class="text" size="20" id="user">
				</div>
				<div class="field">
					<label><?php echo lang('user_pass');?>：</label>
					<input type="password" class="text" size="20" id="password">
				</div>
				<div class="field">
					<label><?php echo lang('yzm');?>：</label>
					<input type="text" class="text1" size="10" id="yzm" value="<?php echo lang('yzm')?>"/>
                    <cite class="yzm"><img style="cursor:pointer;" border="0" onclick="$(this).attr('src','<?php echo site_url('admin/login/code_img');?>'+ '?' + Math.random())" id="yzm_code" src="<?php echo site_url('admin/login/code_img');?>"></cite>
				</div>
				<div class="field">
					<label></label>
					<button id="login_button" class="button" style="margin-left:50px;_margin-left:48px" onclick="login()"></button>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
